{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   value                                               data\n",
      "0      5                       相比金陵十三钗，魏德圣用1.4个亿给了张艺谋狠狠一记耳光\n",
      "1      5                       如果你們的文明是卑躬屈膝, 我要讓你看到野蠻的驕傲!!!\n",
      "2      5                     如果你的文明是叫我们卑躬屈膝，那我就带你们去看看野蛮的骄傲。\n",
      "3      5  《赛德克·巴莱》华语电影里最像大片的大片。土鳖们都在说廉价的诚意却满眼黄金欲望，大谈虚头巴脑...\n",
      "4      5  关于仇恨与战争，最终都会去到泾渭不明、黑白不清的悖论中去，如果在这个过程中连孩子都手染鲜血，...\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "# 读取数据，假设数据文件名为\"data.csv\"\n",
    "data = pd.read_csv(\"all.csv\", names=[\"value\", \"data\"])\n",
    "\n",
    "# 显示数据\n",
    "print(data.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEWCAYAAABMoxE0AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAtbElEQVR4nO3de3xU1b338c8PoiB3FfAAwaY+okCARIgKXiqKFlCqtWIFtaJiPfroU7Gi1dNWOJ5yUB9PRWtvWn1AQBBRBBFRBMFLlasBAYvQcougRDRyM0DC7/lj7wyTMAmBnckQ8n2/XvOavdestfZamcn+zV57z17m7oiIiByuOqlugIiI1GwKJCIiEokCiYiIRKJAIiIikSiQiIhIJAokIiISiQKJJI2Z3Whm78et7zCzU6qo7v8ws7+Fyxlm5maWVkV1nxy2tW5V1HcI2z3JzN41s+1m9j/Vue0y7Yj9bVPJzP5iZr+t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zax7eP7jhjJlSurqH27jgCMSERFJnmQekZTnYWCSmQ0GNgBXA7j7CjObBKwEioA73L04LHM7MBo4DngjfAA8C4w1szUERyIDqqsTIiISqJZA4u5zgbnh8lagVzn5RgAjEqQvAjolSC8kDEQiIpIa+mW7iIhEokAiIiKRKJCIiEgkCiQiIhKJAomIiESiQCIikiKFhYWcddZZZGVlkZmZybBhwwAYPnw4bdq0ITs7m+zsbGbMmBErs2zZMnr06EFmZiadO3emsLCQXbt2cdlll9G+fXsyMzO5//77Y/nXr19Pr1696NKlCz179iQvL++AdkSVit+RiIgIUK9ePebMmUOjRo3Yu3cv5513Hn379gXg7rvvZujQoaXyFxUVcf311zN27FiysrLYunUrxxxzDLt372bo0KFceOGF7Nmzh169evHGG2/Qt29fhg4dyg033MCgQYOYM2cODzzwAGPHjq3SfuiIREQkRcyMRo0aAbB371727t1LRTcwf+utt+jSpQtZWVkAnHjiidStW5cGDRpw4YUXAnDsscfStWvX2JHHypUr6dUr+OnehRdeyNSpUxNXHoECiYhIChUXF5OdnU3Lli255JJLOPvsswF46qmn6NKlCzfffDPffPMNAJ999hlmRu/evenatSuPPvroAfUVFBTw2muvxYJHVlYWL7/8MgBTpkxh+/btbN26tUr7oEAiIpJCdevWJTc3l7y8PBYsWMDy5cu5/fbb+ec//0lubi6tWrXinnvuAYKhrffff5/x48fz/vvvM2XKFGbPnh2rq6ioiIEDB/KLX/yCU045BYDHHnuMefPmccYZZzBv3jzatGlDWlrVntVQIBEROQI0a9aMnj17MnPmTE466STq1q1LnTp1+PnPf86CBQsASE9P54ILLqB58+Y0aNCASy+9lCVLlsTquPXWW2nXrh1DhgyJpbVu3ZpXXnmFjz/+mBEjgjtQNW3atErbrkAiIpIi+fn5FBQUAPDdd9/x9ttv0759ezZv3hzLM2XKFDp1Cm412Lt3b5YtW8auXbsoKipi3rx5dOzYEYDf/OY3fPvtt4waNarUNr766iv27QvmFhw5ciQ333xzlfdDV22JiKTI5s2bGTRoEMXFxXzxRT5t2rRn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YlEgURERCJRIBERkUgUSEREJBIFEhERiUSBREREIlEgERGRSBRIREQkEgUSERGJRIFEREQiUSAREZFIFEhERCQSBRIREYlEgURERCJRIBERkUgUSEREJBIFEhERiUSBREREIlEgERGRSBRIREQkEgUSERGJRIFEREQiUSAREZFIFEhEDuKJJ56gU6dOZGZmMmrUKADuvfde2rdvT5cuXbjyyispKCgAYM+ePdx000107tyZrKws5s6dG6unT58+ZGVlkZmZyW233UZxcXH1d0YkCZIWSMzsOTPbYmbL49JOMLNZZrY6fD4+7rUHzGyNma0ys95x6d3M7JPwtSfNzML0emb2Ypg+38wyktUXqb2WL1/OM888w4IFC1i6dCnTp09n9erVXHLJJSxfvpxly5Zx2mmnMXLkSACeeeYZAD755BNmzZrFPffcw759+wCYNGkSS5cuZfny5eTn5/PSSy+lrF8iVSmZRySjgT5l0u4HZrt7O2B2uI6ZdQQGAJlhmT+ZWd2wzJ+BW4F24aOkzsHAN+5+KvA48EjSeiK11qeffkr37t1p0KABaWlpXHDBBUyZMoUf/vCHpKWlAdC9e3fy8vIAWLlyJb169QKgZcuWNGvWjEWLFgHQpEkTAIqKitizZw/hdyKRGi9pgcTd3wW+LpN8BTAmXB4D/DgufaK773b3tcAa4CwzawU0cfcP3d2B58uUKalrMtDL9J8pVaxTp068++67bN26lV27djFjxgw2btxYKs9zzz1H3759AcjKymLq1KkUFRWxdu1aFi9eXCp/7969admyJY0bN6Z///7V2heRZKnucyQnuftmgPC5ZZjeBoj/78wL09qEy2XTS5Vx9yLgW+DERBs1s1vNbJGZLcrPz6+irkht0KFDB371q19xySWXxM5xlByJAIwYMYK0tDSuu+46AG6++WbS09PJyclhyJAhnHPOOaXyv/nmm2zevJndu3czZ86cau+PSDIcKSfbEx1JeAXpFZU5MNH9aXfPcfecFi1aHGYTpbYaPHgwS5Ys4d133+WEE06gXbt2AIwZM4bp06czfvz42DBVWloajz/+OLm5uUydOpWCgoJY/hL169fn8ssvZ+rUqdXeF5FkqO5A8mU4XEX4vCVMzwP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hAkTSh2NDBs2jLvvvptGjRodkHf8+PG0adOG7du3c9VVVzF27FhuuOGGZDZfRJJIgeQQmVls57h371727t2LmWFmsfMG3377La1btwbgrbfeokuXLmRlZQFw4okHTiu/evVqtmzZwvnnn19NvTh0H3zwAdOmTWPGjBkUFhaybds2rr/+esaNG0dRURGvvPIKixcvjuWfP38+kydP5r777qOgoIA6depQv3597rzzTtq0aQNA48aNufbaa1mwYIECiUgNpkByGIqLi+nWrRtr1qzhjjvu4Oyzz2bUqFH07t2boUOHsm/fPv7+978D8Nlnn2Fm9O7dm/z8fAYMGMB9991Xqr4JEyZwzTXXxOb9PhKNHDmSkSNHAjB37lwee+wxxo0bB8Dbb79N+/btSU/fPyvye++9F1sePnw4jRo14s4776SoqIiCggKaN2/O3r17mT59OhdffHH1dkZEqpQCyWGoW7cuubm5FBQUcOWVV7J8+XKefvppHn/8ca666iomTZrE4MGDefvttykqKuL9999n4cKFNGjQgF69etGtWzd69do/v9fEiRMZO3ZsCntUsQcfHMWGDQWx9S++WMeKFZ9x443DAXj//Vdp0SI9tl5Wbu5c0tKOZfnyHezdu4eZM0fjXsy+fU7r1t+nQYNNbNqkKWdFaioFkgiaNWtGz549mTlzJmPGjOGJJ54A4Oqrr45d2ZSens4FF1xA8+bNAbj00ktZsmRJLJAsXbqUoqIiunXrlppOVMKGDQVkZAyPrWdkQPfuxK0PL1uklIyM0uvt2v33AXk05axIzaWrtg5Rfn4+BQUFAHz33XexYZ3WrVszb948AObMmRO7eql3794sW7aMXbt2UVRUxLx58+jYsWOsvrInqUVEahodkRyizZs3M2jQIIqLi9m3bx8//elP6devH82aNeOuu+6iqKiI+vXr8/TTTwNw/PHH88tf/pIzzzwTM+PSSy/lsssui9U3adIkZsyYkaruiIhEpkByCErOFWRlXRFL+9e/9sXODXTu/KNY+h/+8BrwWmz9zDOvBmDLFkqdS/jBD27g4YcnxtZPPrmZzhWISI2iQHIIyp4rSAadKxCRmkbnSEREJBIFEhERiUSBREREIlEgERGRSBRI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yMMTdt6W6PdXB3YvdPZvgzhBnmdlRP6RpZv2ALe6+ONVtSYFz3b0rwV3T7wiHsyNRICmfbr9Sy4TnCF4Gxrv7K6luT3Vz9wJgLtAntS2pFucCl4fnCyYCF5nZuNQ2qXq4+6bweQswhWAYPxIFkvLp9iu1SHjS+VngU3f/farbU13MrIWZNQuXjwMuBv6R0kZVA3d/wN3T3T2D4H97jrtfn+JmJZ2ZNQwvJsHMGgI/BCJfoalAUg53LwJKbr/yKTApCbdfOeKY2QTgQ+B0M8szs8GpblM1ORf4GcE309zwcWmqG1UNWgHvmNkygi9Ps9y91lwKWwudBLxvZkuBBcDr7j4zaqW6/FdERCLREYmIiESiQCIiIpEokIiISCQKJCIiEokCiYiIRKJAIpIEZjbXzHqXSRtiZn+qIH9O9bROpGopkIgkxwSCH7rFGxCmixxVFEhEkmMy0M/M6kHsRpCtgWvNbFFFc3+Y2Y645f5mNjpcbmFmL5vZwvBxbtJ7IVIJCiQiSeDuWwl+OVxy36oBwIvAr909B+gCXGBmXQ6h2ieAx939TOAqdPtzOUKkpboBIkexkuGtqeHzzcBPw1t3pxHcnqQjsKyS9V0MdAxuCwZAEzNrHM6fIpIyCiQiyfMq8Hsz6wocB3wDDAXOdPdvwiGr+gnKxd+3KP71OkAPd/8uOc0VOTwa2hJJknDmwbnAcwRHJ02AncC3ZnYSwXwQiXxpZh3MrA5wZVz6WwQ3EgXAzLKT0GyRQ6ZAIpJcE4AsYKK7LwU+BlYQBJcPyilzPzAdmANsjkv/BZBjZsvMbCVwW9JaLXIIdPdfERGJREckIiISiQKJiIhEokAiIiKRKJCIiEgkCiQiIhKJAomIiESiQCIiIpH8f73t1Yps8zVUAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 读取数据，假设数据文件名为\"data.csv\"\n",
    "data = pd.read_csv(\"all.csv\", header=None)\n",
    "\n",
    "# 绘制直方图\n",
    "n, bins, patches = plt.hist(data[0], bins=10, color='blue', alpha=0.5, edgecolor='black', histtype='bar', rwidth=0.8)\n",
    "plt.xlabel(\"Value\")\n",
    "plt.ylabel(\"Count\")\n",
    "plt.title(\"Score distribution of movie review data\")\n",
    "\n",
    "# 显示每个条形的值\n",
    "for i in range(len(patches)):\n",
    "    plt.text(patches[i].get_x() + patches[i].get_width() / 2, patches[i].get_height() + 5, str(int(n[i])), ha='center')\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEWCAYAAABMoxE0AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAtE0lEQVR4nO3de3xU1b3//9cHAiI3QbkcudjUI4pySRRQbL2gSLlItVZUUJQqSvWr3xbvenoq1JaD+vNbsK2X2tYDIoJ4oSDFOwXFWkLQgKBFOOWWYyoRRRAMkPD5/bFX4iRMQnBnMiS8n4/HPLJnzVpr1pqZ7M+stffsZe6OiIjIN9Ug3Q0QEZG6TYFERERiUSAREZFYFEhERCQWBRIREYlFgURERGJRIJGUMbMfmdnihPtfmtmxNVT3f5jZH8N2ppm5mWXUUN3HhLY2rIn6DuB525vZm2a23cz+X20+d4V2lL226WRmj5nZz2v5Odeb2Xm1+Zz1QY3840ntM7MzgAeAbkAJ8CEw1t2XprVhVXD35vvLY2b9gKfcvdN+6vqvGmoWZrYeuNbdXw91bwT229YUGAN8CrT0NP7AqyZf2zjc/fp0t6EqZuZAF3dfm+62pJsCSR1kZi2BecANwCygMXAmsKuGn6ehu5fUZJ01wcwy3L043e1IgW8BH6QziNSkevw+SUXurlsduwG9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LjC1988QUdOnQA4NVXX6Vnz55kZWUBcNRR+y7yuGbNGjZv3syZZ55ZS7342ttvv83cuXOZP38+RUVFbNu2jZEjR/LUU09RXFzMCy+8wLJly8ryL1myhOeee4477riDrVu30qBBA5o0acJNN91Ex47R4pYtWrTg8ssvJycnR4FEpB5QIEmBkpISevXqxdq1a7nxxhs57bTTmDx5MgMHDuS2225j7969/O1vfwPgo48+wswYOHAghYWFDB8+nDvuuKNcfTNmzOCyyy4jHUvST5w4kYkTJwKwcOFCHnzwQZ566ikAXn/9dbp27UqnTl+vPZa4YNT48eNp3rw5N910E8XFxWzdupU2bdqwZ88e5s2bx3nnnVe7nRGRlNAxkhRo2LAheXl55Ofnk5OTw8qVK3n00UeZNGkSmzZtYtKkSYwePRqI1vpevHgx06dPZ/HixcyePZs33nijXH0zZ84sN310sDiQdu3atYuBAwfSs2dPsrOz6dixI9ddd12KWygitUEjkhRq1aoV/fr14+WXX2bq1Kk89NBDAFxyySVlZ0B16tSJs88+mzZt2gAwZMgQ3n33Xfr3j5ZtWb58OcXFxfTq1Ss9nUjQr18/+vXrV3Z/ypQpVeYfP3582XazZs3KTYGJSP2hQFLDCgsLadSoEa1ateKrr77i9ddf584776RDhw4sWrSIfv36sWDBgrKznAYOHMgDDzzAzp07ady4MYsWLeLmm28uq6/iweyapqVpRSQuBZIaVlBQwKhRoygpKWHv3r1ceumlDB06lFatWvHTn/6U4uJimjRpwuOPPw5A69atueWWW+jTpw9mxpAhQzj//PPL6ps1axbz589PWXu1NK2IxKVAUsN69uzJe++9t0/6GWecUenUzsiRIxk5cmTSx/75z3/WaPtERGqaDraLiEgsGpEcAB1PEBHZlwLJAdDxBBGRfWlqS0REYlEgERGRWBRIREQkFgUSERGJRYFERERiUSAREZFYFEhERCQWBRIREYlFgURERGJRIBERkVgUSEREJJY6H0jMbJCZrTaztWZ2V7rbIyJyqKnTgcTMGgIPA4OBk4ARZnZSelslInJoqdOBBDgVWOvu/3T33cBM4MI0t0lE5JBi7p7uN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cZXdFOHX4tHS3SSQV6vRSuyIHKzM7HRgKnOLuu8ysDdA4Rn0Z4bdHIgcdjUhEUuNo4FN33wXg7p+6+8dm1sfM/hbWBMkxsxZhnZD/DmtQvGdm5wCY2Y/M7Fkze5HoIn7NwpovS0O+On21aKk/NCIRSY1XgXvM7CPgdeAZol/9PwNc5u5Lzawl8BXwUwB372FmXYmCxvGhntOBnu7+mZn9F9FlQK4JlzrJMbPX3X1H7XZNpDyNSERSIKz70QsYAxQSBZAfAwXuvjTk2Ramq84ApoW0fwAbgNJA8pq7l67x8j3grnAZ+IVAE+CY2uiPSFU0IhFJEXcvIdrhLzSz94EbSb5UQLIlBUoljjYMuNjdV9dYI0VqgEYkIilgZieYWZeEpGyii3N2MLM+IU8LM8sA3gSuCGnHE40ykgWLV4D/G65KjJmdnLoeiFSfRiQiqdEc+G04llEMrCWa5vrvkH440fGR84BHgMfCqKUY+FE406tinb8kWhFwRQgm64nODBNJK139V0REYtHUloiIxKJAIiIisSiQiIhILAokIiISiwKJiIjEokAiIiKxKJCIiEgs/z9yXN9IqDFEwAAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 定义数据\n",
    "x = [0, 1, 2, 3, 4, 5]\n",
    "y = [3867, 4745, 9293, 33331, 49377, 35629]\n",
    "\n",
    "# 绘制直方图\n",
    "plt.bar(x, y, color='blue', alpha=0.5, edgecolor='black')\n",
    "\n",
    "# 显示每个条形的值\n",
    "for i in range(len(x)):\n",
    "    plt.text(x[i], y[i], str(y[i]), ha='center', va='bottom')\n",
    "\n",
    "# 设置图表标题和标签\n",
    "plt.title(\"Score distribution of movie review data\")\n",
    "plt.xlabel(\"Score\")\n",
    "plt.ylabel(\"Count\")\n",
    "\n",
    "# 显示图表\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Done!\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from bs4 import BeautifulSoup\n",
    "import csv\n",
    "\n",
    "# 设置请求头，模拟浏览器访问\n",
    "headers = {\n",
    "    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}\n",
    "\n",
    "# 豆瓣电影链接\n",
    "url = 'https://movie.douban.com/subject/1292052/comments?start='\n",
    "\n",
    "# 定义一个空列表，用于存储所有的影评\n",
    "reviews = []\n",
    "\n",
    "# 循环爬取每一页的影评数据\n",
    "for i in range(0, 200, 20):\n",
    "    # 构造请求链接\n",
    "    link = url + str(i)\n",
    "\n",
    "    # 发送 GET 请求\n",
    "    response = requests.get(link, headers=headers)\n",
    "\n",
    "    # 解析 HTML 页面\n",
    "    soup = BeautifulSoup(response.text, 'html.parser')\n",
    "\n",
    "    # 找到所有的影评标签\n",
    "    comment_tags = soup.find_all('div', class_='comment')\n",
    "\n",
    "    # 循环遍历每个影评标签，提取影评信息\n",
    "    for comment in comment_tags:\n",
    "        # 提取评分\n",
    "        rating_tag = comment.find('span', class_='rating')\n",
    "        rating = rating_tag.get('title') if rating_tag else ''\n",
    "\n",
    "        # 提取评论时间\n",
    "        time_tag = comment.find('span', class_='comment-time')\n",
    "        time = time_tag.get('title') if time_tag else ''\n",
    "\n",
    "        # 提取评论人\n",
    "        author_tag = comment.find('span', class_='comment-info').find('a')\n",
    "        author = author_tag.get_text().strip() if author_tag else ''\n",
    "\n",
    "        # 提取评论内容\n",
    "        content_tag = comment.find('span', class_='short')\n",
    "        content = content_tag.get_text().strip() if content_tag else ''\n",
    "\n",
    "        # 将影评信息存储到字典中\n",
    "        review = {'rating': rating, 'time': time, 'author': author, 'content': content}\n",
    "\n",
    "        # 将字典添加到影评列表中\n",
    "        reviews.append(review)\n",
    "\n",
    "# 将影评列表存储到 CSV 文件中\n",
    "with open('movie_reviews.csv', mode='w', encoding='utf-8', newline='') as file:\n",
    "    writer = csv.DictWriter(file, fieldnames=['rating', 'time', 'author', 'content'])\n",
    "    writer.writeheader()\n",
    "    for review in reviews:\n",
    "        writer.writerow(review)\n",
    "\n",
    "print('Done!')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
